n = input()
s = [i for i in input().split()]
a = input()

try:
    idx = s.index(a)+1
except:
    idx = -1

print("{}".format(idx))
